using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PACKETPARSERMAX20.CORE
{
	public class spell_learn_spell : MangosBase
	{
		public System.UInt16? entry;
		public System.UInt16? spellid;
		public System.Byte? active;




		public override string GetInsertCommand()
		{
			return string.Format("INSERT IGNORE INTO `spell_learn_spell` (`entry`, `spellid`, `active`) VALUES ('{0}', '{1}', '{2}');", entry.GetValueOrDefault(), spellid.GetValueOrDefault(), active.GetValueOrDefault());
		}


		public override string GetUpdateCommand()
		{
            StringBuilder sb = new StringBuilder();
						sb.Append("UPDATE `spell_learn_spell` SET ");
			if(spellid != null)
			{
				sb.AppendLine("`spellid`='" + spellid.Value.ToString() + "'");
			}
			if(active != null)
			{
				sb.AppendLine("`active`='" + active.Value.ToString() + "'");
			}
				sb = sb.Replace("\r\n", ", ");
				sb.Append(" WHERE `entry`='" + entry.Value.ToString() + "';");
				sb = sb.Replace(",  WHERE", " WHERE");

            return sb.ToString();
		}


	}
}
